<ul class="model_actions">
    <li>
        <?php echo CHtml::beginForm(); ?>
        更改分类：
        <?php
        $cache_key = 'cache_item_media_categories_for_change_media_category';
        $has_cache = Yii::app()->cache->get($cache_key);
        if ($has_cache === false) {
            $datas = MediaCategory::model()->getCTreeViewDatas();
            require_once(Yii::app()->basePath . '/extensions/GraphTree/tree.php');
            $datas = dumpArrayTree($datas);
            $media_categories = array('' => Yii::t('common', 'please_select'));
            if (count($datas)) {
                foreach ($datas as $data) {
                    $media_categories[$data['id']] = $data['levelstr'] . '⇒ ' . strip_tags($data['text']) . '《' . (string)$data['files_count'] . '》';
                }
            } else {
                $media_categories = array();
            }

            Yii::app()->cache->set($cache_key, $media_categories, 300);
        } else {
            $media_categories = Yii::app()->cache->get($cache_key);
        }

        echo CHtml::dropDownList('category_id', 0, $media_categories, array('onchange' => "fnChangeCategory();"));
        ?>
        <?php
        echo CHtml::hiddenField('show_type', 'icon');
        echo CHtml::endForm();
        ?>
    </li>
    <?php
    $i = 0;
    $prefix = 'backend/';
    foreach ($items as $url => $caption):
        $i++;
        $url_fix = split('@', $url);
        if (!isset($url_fix[1])) {
            $url_fix = Yii::app()->createUrl($prefix . $url);
        } else {
            $tmp = split('/', $url_fix[1]);
            $url_fix = Yii::app()->createUrl($prefix . $url_fix[0], array($tmp[0] => $tmp[1]));
        }
        $controller = Yii::app()->controller;
        $current = (($controller->id . '/' . $controller->action->id) == $url) ? 'current' : '';
//        $current = 'current';
    ?>
    <li class="<?php if ($i == 1) echo 'first'; ?>">
        <?php echo CHtml::link($caption, $url_fix, array('class' => $current)); ?>
    </li>
    <?php endforeach; ?>
</ul>

